# This file is part of BlackArch Linux ( https://www.blackarch.org/ ).
# See COPYING for license details.

pkgname=python-http-tools
_pkgname=http-tools
pkgver=5.0.0
pkgrel=1
pkgdesc='httptools helps you to capture, repeat and live intercept HTTP requests. It is built on top of [mitmproxy].'
arch=('any')
url='https://pypi.org/project/http-tools/#files'
license=('GPL3')
depends=('python' 'mitmproxy')
makedepends=('python-setuptools')
source=("https://files.pythonhosted.org/packages/source/${_pkgname::1}/$_pkgname/$_pkgname-$pkgver.tar.gz")
sha512sums=('00a31374cf455c148e91b9dc214074981b92b53d15159d3946a3b4b3cf936f7eaa219a0d45a6f709cc4165fbb66100461a727c0a6552e1c38dfda1c87ea9aa9c')

prepare() {
  cd "$_pkgname-$pkgver"

  sed -i 's/>=6.0.0<=6.0.2//' setup.py
}

build() {
  cd "$_pkgname-$pkgver"

  python setup.py build
}

package() {
  cd "$_pkgname-$pkgver"

  python setup.py install --prefix=/usr --root="$pkgdir" -O1 --skip-build
}

